package com.baor.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baor.dao.VersionConfigMapper;
import com.baor.domain.VersionConfig;
import com.baor.service.VersionConfigService;
import org.springframework.stereotype.Service;

@Service
public class VersionConfigServiceImpl extends ServiceImpl<VersionConfigMapper, VersionConfig> implements VersionConfigService {

    @Override
    public VersionConfig getByAppType(String appType) {
        LambdaQueryWrapper<VersionConfig> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(VersionConfig::getAppType, appType);
        return getOne(wrapper);
    }

    @Override
    public boolean updateVersion(VersionConfig versionConfig) {
        return updateById(versionConfig);
    }
}
